package com.lagou.resume.service.impl;

import com.lagou.resume.dao.ResumeDao;
import com.lagou.resume.pojo.Resume;
import com.lagou.resume.service.IResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 简历的业务层实现类
 * @autor yangzhenhao
 */
@Service("resumeService")
@Transactional
public class ResumeServiceImpl implements IResumeService {

    @Autowired
    private ResumeDao resumeDao;

    @Override
    public List<Resume> findAll() {
        List<Resume> resumeList = resumeDao.findAll();
        return resumeList;
    }

    @Override
    public void deleteByID(Long id) {
        resumeDao.deleteById(id);
    }

    @Override
    public void saveOrUpdate(Resume resume) {
        resumeDao.saveAndFlush(resume);
    }
}
